<html>
<head><meta charset="utf-8"><title>extend source code viewer · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html">extend source code viewer</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232805363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232805363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232805363">(Apr 01 2021 at 18:44)</a>:</h4>
<p>I intend to extend a bit the source code viewer by turning functions and types used into links to their definition. So if you have:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="n">x</span>: <span class="nb">String</span> <span class="o">=</span><span class="w"> </span><span class="s">"12"</span><span class="p">.</span><span class="n">to_owned</span><span class="p">();</span><span class="w"></span>
</code></pre></div>
<p><code>String</code> would link to the <code>String</code> definition. As a second step, it'd be awesome to be able to generate link for <code>to_owned</code> too but let's do it one step at a time. Depending on how we implement it, it could be very trivial though.</p>
<p>I took a quick look to see how we do currently but we use something close to what we have in proc macro, meaning we only have tokens. I looked around a bit but I don't think we can extract much information just from a <code>Span</code> and the <code>TyCtxt</code> (unless I missed it) so I plan to keep a copy of the original AST we get and then use it alongside the tokens so that I can get the item from its span.</p>
<p>So I opened this topic mostly to see with you if that sounds like a valid approach to you or if maybe you have some other ideas?</p>



<a name="232808044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232808044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232808044">(Apr 01 2021 at 19:02)</a>:</h4>
<p>I don't think you can do this with only the AST, you at least need the <code>Res</code> of the type</p>



<a name="232808243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232808243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232808243">(Apr 01 2021 at 19:04)</a>:</h4>
<p>in general to link type-relative paths you'll need at least the HIR. To link <code>to_owned()</code> you'll need type information which will break <a href="https://doc.rust-lang.org/nightly/rustdoc/advanced-features.html#cfgdoc-documenting-platform-specific-or-feature-specific-information">https://doc.rust-lang.org/nightly/rustdoc/advanced-features.html#cfgdoc-documenting-platform-specific-or-feature-specific-information</a>.  So you'll need to ignore errors and let the links go if they cause an error.</p>



<a name="232830892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232830892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232830892">(Apr 01 2021 at 21:58)</a>:</h4>
<p>I think this is a major expansion of scope and should not be taken lightly. I've wanted this for a while as well; but you need a _lot_ more analysis to do this right. It will also bloat the src sizes a ton.</p>
<p>Note that there already exists a tool that does this: <a href="https://github.com/rust-dev-tools/cargo-src">https://github.com/rust-dev-tools/cargo-src</a> . We should consider putting effort into that _first_, and then perhaps making that a dependency of rustdoc. I'm very wary of making it a part of rustdoc.</p>



<a name="232838936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232838936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232838936">(Apr 01 2021 at 23:22)</a>:</h4>
<p>Also, if we end up implementing this, I think we should keep the UI the same (i.e., no link underlines) so as not to make the output busy.</p>



<a name="232874440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232874440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232874440">(Apr 02 2021 at 08:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307537">Camelid</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/232838936">said</a>:</p>
<blockquote>
<p>Also, if we end up implementing this, I think we should keep the UI the same (i.e., no link underlines) so as not to make the output busy.</p>
</blockquote>
<p>Agreed. I intended to just updated when you go over it like we do in the item path at the top of the items' page.</p>
<p><span class="user-mention" data-user-id="132040">@Manish Goregaokar</span> This is why I wanted to give a try: to be able to actually see the difference both in file size and in rendering performance. With all this information, we can see exactly the impact.</p>



<a name="232874542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232874542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232874542">(Apr 02 2021 at 08:28)</a>:</h4>
<p>Seems fair. My understanding is that cargo src is a heavy piece of software, and from what I know from clippy this stuff is pretty heavy, so worth experimenting but I think cargo-src is a good place to put effort into a reusable library that rustdoc can then use</p>



<a name="232875516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232875516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232875516">(Apr 02 2021 at 08:41)</a>:</h4>
<p>My understanding is that cargo-src is going through all code once again. If we could re-use the information rustdoc has directly, we might be able to cut down the run time. But that could be interesting to see that directly with nrc. Well, first, I'll start reading cargo-src source code and see how they do.</p>



<a name="232890040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232890040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232890040">(Apr 02 2021 at 11:48)</a>:</h4>
<p>Actually no: cargo-src is relying on rls, so cannot be used inside rustdoc...</p>



<a name="232900233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232900233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232900233">(Apr 02 2021 at 13:45)</a>:</h4>
<p>FWIW I've had pretty good success in some research work I've been doing with running rust-analyzer as a subprocess and doing go-to-def queries to recover information from an AST, and that is actually really fast overall</p>



<a name="232900414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232900414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232900414">(Apr 02 2021 at 13:47)</a>:</h4>
<p>Someone just suggested me to look at the rust-analyzer source code. If it can be used as a library, that'd make this whole thing muuuuch simpler</p>



<a name="232901246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232901246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232901246">(Apr 02 2021 at 13:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="132040">Manish Goregaokar</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/232830892">said</a>:</p>
<blockquote>
<p>I think this is a major expansion of scope and should not be taken lightly. I've wanted this for a while as well; but you need a _lot_ more analysis to do this right. It will also bloat the src sizes a ton.</p>
<p>Note that there already exists a tool that does this: <a href="https://github.com/rust-dev-tools/cargo-src">https://github.com/rust-dev-tools/cargo-src</a> . We should consider putting effort into that _first_, and then perhaps making that a dependency of rustdoc. I'm very wary of making it a part of rustdoc.</p>
</blockquote>
<p>I am also unconvinced FWIW that this is a good fit for rustdoc's src view; it feels like a pretty large expansion in scope and may be better suited for an alternative tool. I'm wary of pushing too much static analysis into rustdoc, personally.</p>



<a name="232901304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232901304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232901304">(Apr 02 2021 at 13:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="210316">GuillaumeGomez</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/232900414">said</a>:</p>
<blockquote>
<p>Someone just suggested me to look at the rust-analyzer source code. If it can be used as a library, that'd make this whole thing muuuuch simpler</p>
</blockquote>
<p>The LSP protocol is not too hard to get started with, fwiw, I don't think using it as a binary over that would cause many problems for prototyping</p>



<a name="232901326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232901326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232901326">(Apr 02 2021 at 13:55)</a>:</h4>
<p>I managed to get goto-def with ~100 lines of code or so</p>



<a name="232901390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232901390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232901390">(Apr 02 2021 at 13:56)</a>:</h4>
<p>(Can put up a gist of that file if useful)</p>



<a name="232902371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232902371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232902371">(Apr 02 2021 at 14:05)</a>:</h4>
<p>I was hoping to not run the server part and simply use their library to build the map I needed</p>



<a name="232902754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232902754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232902754">(Apr 02 2021 at 14:09)</a>:</h4>
<p>I mean, I hear you, but for experimentation I don't think the server being around is really that bad, and gets you up and running much faster :)</p>



<a name="232902939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232902939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232902939">(Apr 02 2021 at 14:10)</a>:</h4>
<p>then sure, I'd gladly like to have that gist ;)</p>



<a name="232903698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903698">(Apr 02 2021 at 14:17)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> <a href="https://gist.github.com/Mark-Simulacrum/c173aa652d1e327358c9279120a9896c">https://gist.github.com/Mark-Simulacrum/c173aa652d1e327358c9279120a9896c</a></p>



<a name="232903731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903731">(Apr 02 2021 at 14:17)</a>:</h4>
<p>Thanks!</p>



<a name="232903778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903778">(Apr 02 2021 at 14:18)</a>:</h4>
<p>that has the constants defined in a sort of hacky way for my use case (that particular one is off of a c file) but it shouldn't be hard to alter them for rust etc</p>



<a name="232903801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903801">(Apr 02 2021 at 14:18)</a>:</h4>
<p>(e.g., I think that invokes clangd and not rust-analyzer)</p>



<a name="232903850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903850">(Apr 02 2021 at 14:18)</a>:</h4>
<p>but it should work with minor adjustments for rust-analyzer too, happy to help with questions as well</p>



<a name="232903861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903861">(Apr 02 2021 at 14:18)</a>:</h4>
<p>I'll alter the code as needed then ;)</p>



<a name="232903886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903886">(Apr 02 2021 at 14:19)</a>:</h4>
<p>but first, a break</p>



<a name="232903891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/232903891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#232903891">(Apr 02 2021 at 14:19)</a>:</h4>
<p>thanks again!</p>



<a name="233399084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233399084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233399084">(Apr 06 2021 at 22:13)</a>:</h4>
<p>an idea I posted elsewhere which may be relevant is that I think a good way forward here is to make cargo-src really good (and maybe make it possible for it to output static html pages), and then give rustdoc a config to change its src links to something else. this can also be useful for having src link to github</p>



<a name="233399149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233399149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233399149">(Apr 06 2021 at 22:14)</a>:</h4>
<p>and we can work on shipping cargo-src, and having tigher integration, but we'd have a separate cargo-src team</p>



<a name="233399170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233399170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233399170">(Apr 06 2021 at 22:14)</a>:</h4>
<p>and they would commit to building that tool as is</p>



<a name="233399181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233399181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233399181">(Apr 06 2021 at 22:14)</a>:</h4>
<p>because adding this in rustdoc is a _huge_ expansion of scope</p>



<a name="233399499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233399499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233399499">(Apr 06 2021 at 22:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="132040">Manish Goregaokar</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/233399149">said</a>:</p>
<blockquote>
<p>and we can work on shipping cargo-src, and having tigher integration, but we'd have a separate cargo-src team</p>
</blockquote>
<p><em>is</em> there a cargo-src team btw? I haven't seen activity in the discord channel since december 2019 <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="233499657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233499657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233499657">(Apr 07 2021 at 14:41)</a>:</h4>
<p>There is not; it was kinda built as a proof of concept for RLS</p>



<a name="233506193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233506193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233506193">(Apr 07 2021 at 15:09)</a>:</h4>
<p>I clarified this with nox on twitter but it's worth clarifying here too: I don't mean to say that "cargo-src exists so we shouldn't do this", or that we should add it to cargo-src: cargo-src has problems too; it is server-based (unlike rustdoc, which is files-based), and uses RLS save-analysis stuff, and doesn't currently work.</p>
<p>I mostly mean that I would like to see this in a separate tool _like_ cargo-src. <a href="http://Docs.rs">Docs.rs</a> can use it by default, and we can make it easy for others to use by default, but I'd rather have a first-class separately-maintained tool for this.</p>



<a name="233506835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233506835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233506835">(Apr 07 2021 at 15:11)</a>:</h4>
<p>This could even be a pluggable "source generation" library</p>



<a name="233506919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233506919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233506919">(Apr 07 2021 at 15:11)</a>:</h4>
<p>so rustdoc's current source library just generates sources, but you can plug in this library and get better stuff</p>



<a name="233506940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233506940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233506940">(Apr 07 2021 at 15:11)</a>:</h4>
<p>and there's a way to use it separately</p>



<a name="233507226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233507226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233507226">(Apr 07 2021 at 15:12)</a>:</h4>
<p>ooh like pretty_assert</p>



<a name="233507233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233507233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233507233">(Apr 07 2021 at 15:12)</a>:</h4>
<p>I like that</p>



<a name="233507779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233507779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233507779">(Apr 07 2021 at 15:14)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> instead of discussing this over twitter</p>



<a name="233508103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233508103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233508103">(Apr 07 2021 at 15:15)</a>:</h4>
<p>I don't see the point of having that done in a separate library. :-/</p>



<a name="233508325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233508325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233508325">(Apr 07 2021 at 15:16)</a>:</h4>
<p>As for twitter, I'm simply providing info there too. ;)</p>



<a name="233508440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233508440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233508440">(Apr 07 2021 at 15:17)</a>:</h4>
<p>But just for here to have as much information: this is my WIP: <a href="https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:src-to-definition?expand=1">https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:src-to-definition?expand=1</a></p>



<a name="233508465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233508465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233508465">(Apr 07 2021 at 15:17)</a>:</h4>
<p>as you can see, it's really small</p>



<a name="233508561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233508561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233508561">(Apr 07 2021 at 15:17)</a>:</h4>
<p>it doesn't try to do much and I don't think we should do much more than that</p>



<a name="233509501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233509501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233509501">(Apr 07 2021 at 15:23)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> I think this prototype is pretty small and i would be fine with maintaining just this functionality; i'm not convinced that a _good_ version of this feature will be at all this simple</p>



<a name="233509534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233509534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233509534">(Apr 07 2021 at 15:23)</a>:</h4>
<p>my argument in favor of that is "look how big cargo-src is"</p>



<a name="233509811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233509811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233509811">(Apr 07 2021 at 15:24)</a>:</h4>
<p>No, cargo-src is handling cross-crates and a lot more things like providing documentation directly when you hover something</p>



<a name="233509885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233509885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233509885">(Apr 07 2021 at 15:24)</a>:</h4>
<p>yeah</p>



<a name="233509908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233509908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233509908">(Apr 07 2021 at 15:25)</a>:</h4>
<p>why shouldn't we handle cross-crate?</p>



<a name="233509960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233509960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233509960">(Apr 07 2021 at 15:25)</a>:</h4>
<p>that's kinda my point, cross-crate seems like crucial functionality here?</p>



<a name="233509996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233509996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233509996">(Apr 07 2021 at 15:25)</a>:</h4>
<p>(might be misunderstanding cross-crate)</p>



<a name="233510047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233510047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233510047">(Apr 07 2021 at 15:25)</a>:</h4>
<p>well, for example I didn't plan to allow to provide link on <code>String</code> in things outside std</p>



<a name="233510124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233510124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233510124">(Apr 07 2021 at 15:26)</a>:</h4>
<p>okay, this is exactly my point :)</p>



<a name="233510209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233510209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233510209">(Apr 07 2021 at 15:26)</a>:</h4>
<blockquote>
<p>i'm not convinced that a _good_ version of this feature will be at all this simple</p>
</blockquote>
<p>I think cross-crate is an example of what people will expect for a good version of this</p>



<a name="233510245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233510245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233510245">(Apr 07 2021 at 15:26)</a>:</h4>
<p>Well, good version can come a loooot later</p>



<a name="233510287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233510287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233510287">(Apr 07 2021 at 15:26)</a>:</h4>
<p>my argument is not one of implementation effort</p>



<a name="233510293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233510293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233510293">(Apr 07 2021 at 15:27)</a>:</h4>
<p>for now we can simply have it on nightly and that's it</p>



<a name="233510332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233510332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233510332">(Apr 07 2021 at 15:27)</a>:</h4>
<p>oh, my bad, please explain then</p>



<a name="233511376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233511376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233511376">(Apr 07 2021 at 15:32)</a>:</h4>
<p>so taking a step back this is what i mean by expansion of scope, too: right now, [src] is bare minimum, and people expect it to be bare minimum. people do not ask for features to make it _the absolutely best perfect src viewers_. right? i  mean, there are feature requests, but not huge ones.</p>
<p>This is fine, this isn't great; but as a team we focus on maintaining certain areas of rustdoc. we don't do much with src, we also don't need to spend time on it. great!</p>
<p>the moment we try to make src do lots of cool things that you _cannot find otherwise_, that becomes a primary focus of the tool. rustdoc becomes the tool for generating crosslinked src. which is fine, but it also means that people will want it to be _good_, and this means it becomes very dumb for us to _not_ support things like cross-crate :)</p>
<p>remember that intra doc links also went through an rfc, and it also took a while for it to get things like cross-crate and such. it's a significant portion of our maintenance burden now, which is _fine_, but the team agreed to maintain that</p>



<a name="233511391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233511391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233511391">(Apr 07 2021 at 15:32)</a>:</h4>
<p>(in meetings)</p>



<a name="233511857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233511857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233511857">(Apr 07 2021 at 15:35)</a>:</h4>
<p>Yes and it's handled correctly. If your main argument is the maintenance burden, then I don't see the issue. People want more out of the source code viewer as the tweet reactions showed. I don't see any issue with implementing it</p>



<a name="233512195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512195">(Apr 07 2021 at 15:36)</a>:</h4>
<p>I think with an RFC we can see what people would want in such a thing and then carefully define our scope</p>



<a name="233512234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512234">(Apr 07 2021 at 15:37)</a>:</h4>
<p>because it's quite possible they'll want things like "link every identifier to its type" (HUGE amount of load)</p>



<a name="233512405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512405">(Apr 07 2021 at 15:38)</a>:</h4>
<p>I don't think an RFC is that big a barrier here</p>



<a name="233512453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512453">(Apr 07 2021 at 15:38)</a>:</h4>
<p>But an RFC would prevent us to do anything until then. What I suggest is instead to have something small only on nightly and when we have something, we then write an RFC to stabilize it</p>



<a name="233512469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512469">(Apr 07 2021 at 15:38)</a>:</h4>
<p>it definitely is</p>



<a name="233512522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512522">(Apr 07 2021 at 15:38)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> oh i'm happy to allow this to land on nightly behind a cli flag</p>



<a name="233512528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512528">(Apr 07 2021 at 15:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="210316">GuillaumeGomez</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/233512453">said</a>:</p>
<blockquote>
<p>But an RFC would prevent us to do anything until then. What I suggest is instead to have something small only on nightly and when we have something, we then write an RFC to stabilize it</p>
</blockquote>
<p>I am strongly against this because <a href="http://docs.rs">docs.rs</a> uses nightly</p>



<a name="233512549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512549">(Apr 07 2021 at 15:38)</a>:</h4>
<p>the second people can use it they will, and they'll be mad if it's removed</p>



<a name="233512559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512559">(Apr 07 2021 at 15:38)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> okay behind a cli flag that <a href="http://docs.rs">docs.rs</a> doesn't use?</p>



<a name="233512597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512597">(Apr 07 2021 at 15:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="132040">Manish Goregaokar</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/233512559">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> okay behind a cli flag that <a href="http://docs.rs">docs.rs</a> doesn't use?</p>
</blockquote>
<p>I would still rather not because you can pass custom rustflags</p>



<a name="233512614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512614">(Apr 07 2021 at 15:39)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Should have precised a nightly argument, my bad</p>



<a name="233512664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512664">(Apr 07 2021 at 15:39)</a>:</h4>
<p>like, I'm ok if we get consensus that we want "something like this" and then put it on nightly behind a feature gate</p>



<a name="233512689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512689">(Apr 07 2021 at 15:39)</a>:</h4>
<p>but I don't think we should implement it before we decide whether we want it at all</p>



<a name="233512708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512708">(Apr 07 2021 at 15:39)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> oh yeah feature gate is fine</p>



<a name="233512835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512835">(Apr 07 2021 at 15:40)</a>:</h4>
<p>I feel like I'm not explaining this well :/</p>



<a name="233512876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512876">(Apr 07 2021 at 15:40)</a>:</h4>
<blockquote>
<p>the second people can use it they will, and they'll be mad if it's removed<br>
we kinda made this mistake with intra-doc, though we didn't really want to remove it</p>
</blockquote>



<a name="233512885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512885">(Apr 07 2021 at 15:40)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> from twitter, it seems quite unanimous. In any case, my PR is far from done so we have plenty of time. And until it's stabilized, we can completely change it as many times as we want</p>



<a name="233512928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512928">(Apr 07 2021 at 15:40)</a>:</h4>
<p>my concern is that people will use it as if it's stable whether it has a feature gate or not, look at all the people going to <a href="https://github.com/rust-lang/rust/issues/82768">https://github.com/rust-lang/rust/issues/82768</a> saying they want to use it on <a href="http://docs.rs">docs.rs</a> immediately</p>



<a name="233512977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512977">(Apr 07 2021 at 15:41)</a>:</h4>
<blockquote>
<p>And until it's stabilized, we can completely change it as many times as we want</p>
</blockquote>
<p>that's my point though, if people start using it immediately we can't really :/</p>



<a name="233512981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233512981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233512981">(Apr 07 2021 at 15:41)</a>:</h4>
<p>I can understand them haha</p>



<a name="233513011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513011">(Apr 07 2021 at 15:41)</a>:</h4>
<p>No, if it's nightly, it's prone to change</p>



<a name="233513033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513033">(Apr 07 2021 at 15:41)</a>:</h4>
<p>that's the deal</p>



<a name="233513056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513056">(Apr 07 2021 at 15:41)</a>:</h4>
<p>it's like a preview feature: "use it at your own risk"</p>



<a name="233513070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513070">(Apr 07 2021 at 15:41)</a>:</h4>
<p>maybe the solution here is <a href="http://docs.rs">docs.rs</a> shouldn't use nightly</p>



<a name="233513160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513160">(Apr 07 2021 at 15:42)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> it needs to because some crates are nightly only</p>



<a name="233513163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513163">(Apr 07 2021 at 15:42)</a>:</h4>
<p>I don't see any other way for stability guarentees to actually mean something</p>



<a name="233513302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513302">(Apr 07 2021 at 15:43)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> i said this in the case of notable_trait, but you've gotta be careful making conclusions off of twitter/etc like that because the conclusion you can make from your tweet is that folks want this functionality _somewhere_.</p>
<p>I'm totally fine with this feature being something rustdoc can hook into (even by default!). I'm just wary of maintaining it inside rustdoc _without understanding the scope_. An RFC helps us understand the scope</p>



<a name="233513482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513482">(Apr 07 2021 at 15:44)</a>:</h4>
<p>and <span class="user-mention" data-user-id="232545">@Joshua Nelson</span>'s point beautifully illustrates why product-oriented thinking is important here, in that analogy <a href="http://docs.rs">docs.rs</a> is our consumer and we need to make sure they can deal</p>



<a name="233513630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513630">(Apr 07 2021 at 15:45)</a>:</h4>
<p>nightly features are prone to breaking change, so i don't see how it comes in scope here</p>



<a name="233513686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513686">(Apr 07 2021 at 15:45)</a>:</h4>
<p>I agree for the RFC, but only once we have tested the feature for some time and got feedback so we know what is expected</p>



<a name="233513721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513721">(Apr 07 2021 at 15:45)</a>:</h4>
<p>Just to chime in, I personally like the sound of the 'pluggable' approach Manish mentioned.</p>



<a name="233513798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513798">(Apr 07 2021 at 15:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="210316">GuillaumeGomez</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/233513686">said</a>:</p>
<blockquote>
<p>I agree for the RFC, but only once we have tested the feature for some time and got feedback so we know what is expected</p>
</blockquote>
<p>this is what experimental RFCs are for</p>



<a name="233513826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513826">(Apr 07 2021 at 15:46)</a>:</h4>
<p>so you don't have to lock down the final product, you're just exploring the space</p>



<a name="233513863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513863">(Apr 07 2021 at 15:46)</a>:</h4>
<p>I really don't like the idea of adding this without at least an eRFC</p>



<a name="233513984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233513984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233513984">(Apr 07 2021 at 15:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="319144">CraftSpider</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/233513721">said</a>:</p>
<blockquote>
<p>Just to chime in, I personally like the sound of the 'pluggable' approach Manish mentioned.</p>
</blockquote>
<p>I'm curious: why?</p>



<a name="233514011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514011">(Apr 07 2021 at 15:47)</a>:</h4>
<p>would it make sense to have the intra-doc links as a plugin too?</p>



<a name="233514030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514030">(Apr 07 2021 at 15:47)</a>:</h4>
<p>and themes too?</p>



<a name="233514242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514242">(Apr 07 2021 at 15:48)</a>:</h4>
<p>themes <em>are</em> a plugin</p>



<a name="233514251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514251">(Apr 07 2021 at 15:49)</a>:</h4>
<p>you can pass <code>--theme</code> on stable</p>



<a name="233514282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514282">(Apr 07 2021 at 15:49)</a>:</h4>
<p>No, they are not</p>



<a name="233514294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514294">(Apr 07 2021 at 15:49)</a>:</h4>
<p>It's an option</p>



<a name="233514312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514312">(Apr 07 2021 at 15:49)</a>:</h4>
<p>there are 3 by default and you can extend them</p>



<a name="233514317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514317">(Apr 07 2021 at 15:49)</a>:</h4>
<p>themes have an "API" that is the "stable" css classes</p>



<a name="233514327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514327">(Apr 07 2021 at 15:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="210316">GuillaumeGomez</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/233514312">said</a>:</p>
<blockquote>
<p>there are 3 by default and you can extend them</p>
</blockquote>
<p>that is literally what a plugin is lol</p>



<a name="233514376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514376">(Apr 07 2021 at 15:49)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> curious: when we say pluggable, are you assuming that we're declaring it won't be the default?</p>



<a name="233514384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514384">(Apr 07 2021 at 15:49)</a>:</h4>
<p>because that's not what we're saying</p>



<a name="233514392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514392">(Apr 07 2021 at 15:49)</a>:</h4>
<p>Ah, maybe we have a different meaning for plugin</p>



<a name="233514460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514460">(Apr 07 2021 at 15:50)</a>:</h4>
<p>pluggable = can be swapped out</p>



<a name="233514475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514475">(Apr 07 2021 at 15:50)</a>:</h4>
<p>No, what I'm afraid of is that we put it somewhere outside of rustdoc</p>



<a name="233514489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514489">(Apr 07 2021 at 15:50)</a>:</h4>
<p>aaaah</p>



<a name="233514510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514510">(Apr 07 2021 at 15:50)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> can you expand on what you mean here?</p>



<a name="233514531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514531">(Apr 07 2021 at 15:50)</a>:</h4>
<p>if that's what you mean, I intended to disable it by default at first</p>



<a name="233514533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514533">(Apr 07 2021 at 15:50)</a>:</h4>
<p>my concern is _maintenance_ wise</p>



<a name="233514551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514551">(Apr 07 2021 at 15:50)</a>:</h4>
<p>it should perhaps be outside of rustdoc</p>



<a name="233514578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514578">(Apr 07 2021 at 15:51)</a>:</h4>
<p>OR it should be well-scoped enough that the rustdoc team is happy with taking on the maintenance efforts</p>



<a name="233514582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514582">(Apr 07 2021 at 15:51)</a>:</h4>
<p>It's tightly bound to rustdoc and shouldn't be put outside of rustdoc</p>



<a name="233514642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514642">(Apr 07 2021 at 15:51)</a>:</h4>
<p>and I'm happy with taking the maintenance for it (I'm paid to work on rustdoc now so I have more time now)</p>



<a name="233514663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514663">(Apr 07 2021 at 15:51)</a>:</h4>
<p>Intra-doc links, no. They're more fundamental, and I believe much harder to implement that way. Themes already <em>are</em> customizable, just in a different way.<br>
Implementing it this way gets two advantages:<br>
1) If we want it ourselves, this way doesn't stop that, but it also allows us to not<br>
2) I think a good design would often look like this to some degree anyways, this ensures forward compat is considered.</p>



<a name="233514753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514753">(Apr 07 2021 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> I don't think a single person being able to maintain a thing is sufficient</p>



<a name="233514774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514774">(Apr 07 2021 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@CraftSpider</span> Didn't understand your explanations at all, sorry :s</p>



<a name="233514848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514848">(Apr 07 2021 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> also stepping back a bit for _good_ design i actually think the pluggable thing is better -- I personally have _often_ wanted to generate docs that link to github</p>



<a name="233514850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514850">(Apr 07 2021 at 15:52)</a>:</h4>
<p>Ah, sorry. Give me a minute, I'll be back not on my phone</p>



<a name="233514875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514875">(Apr 07 2021 at 15:52)</a>:</h4>
<p>so having --srclinks plain --srclinks github --srclinks fancy</p>



<a name="233514919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514919">(Apr 07 2021 at 15:53)</a>:</h4>
<p>idk</p>



<a name="233514932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514932">(Apr 07 2021 at 15:53)</a>:</h4>
<p>people with size constraints can do --srclinks plain</p>



<a name="233514936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514936">(Apr 07 2021 at 15:53)</a>:</h4>
<p>I don't like this approach but I think it's a point of view thing here</p>



<a name="233514939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514939">(Apr 07 2021 at 15:53)</a>:</h4>
<p>or even --srclinks none</p>



<a name="233514969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514969">(Apr 07 2021 at 15:53)</a>:</h4>
<p>like i think there's a lot of cool stuff we could do if there's a flag like we have for themes</p>



<a name="233514988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233514988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233514988">(Apr 07 2021 at 15:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="132040">Manish Goregaokar</span> <a href="#narrow/stream/266220-rustdoc/topic/extend.20source.20code.20viewer/near/233514848">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="210316">GuillaumeGomez</span> also stepping back a bit for _good_ design i actually think the pluggable thing is better -- I personally have _often_ wanted to generate docs that link to github</p>
</blockquote>
<p><a href="http://docs.rs">docs.rs</a> also wants to do this</p>



<a name="233515082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515082">(Apr 07 2021 at 15:54)</a>:</h4>
<p>this is exactly why I think there should be an RFC, so stakeholders have a place to say what would be useful</p>



<a name="233515090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515090">(Apr 07 2021 at 15:54)</a>:</h4>
<p>what I have in mind is <code>--enable-src-definitions</code> until we have a good enough thing (or an RFC)</p>



<a name="233515210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515210">(Apr 07 2021 at 15:54)</a>:</h4>
<p>sure</p>



<a name="233515220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515220">(Apr 07 2021 at 15:54)</a>:</h4>
<p>But I agree that it should disabled</p>



<a name="233515240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515240">(Apr 07 2021 at 15:54)</a>:</h4>
<p>happy to land a proof of concept as long as it is small enough</p>



<a name="233515257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515257">(Apr 07 2021 at 15:55)</a>:</h4>
<p>if that's what a plugin means to you, we agree on that</p>



<a name="233515272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515272">(Apr 07 2021 at 15:55)</a>:</h4>
<p>well</p>



<a name="233515314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515314">(Apr 07 2021 at 15:55)</a>:</h4>
<p>i hold multiple opinions here</p>



<a name="233515333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515333">(Apr 07 2021 at 15:55)</a>:</h4>
<p>What i want to avoid is having it in a different repository</p>



<a name="233515385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233515385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233515385">(Apr 07 2021 at 15:55)</a>:</h4>
<p>(or in a different crate)</p>



<a name="233516858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233516858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233516858">(Apr 07 2021 at 16:04)</a>:</h4>
<p>Firstly, I think we should be very clear on the scope of this. An RFC is enough for that. We should ask in a pre-rfc post what people would like to see in such a feature.</p>
<p>If the scope is pretty large, I would prefer it to be a different "project" (can just be a folder under src/tools/rustdoc or src/tools), with perhaps its own list of maintainers (OWNERS file if it's under rustdoc/), and perhaps able to be run on its own (i would _love_ that). rustdoc can integrate directly into it so from the user's pov it doesn't matter. This is _entirely_ a maintenance concern. The user doesn't need to care.</p>
<p>by pluggable I mean that for src generation we could have a set of traits and you can write different src generators. Because these APIs are unstable basically only rustdoc will write such src generators, but my main concern is that I don't want src generation stuff to leak into the rest of the code.</p>
<p>So then rustdoc could have html/srcgen/plain and srcgen/fancy and srcgen/github folders, and each would implement this trait. that way it's _clean_,  we don't have to worry about it when working on the rest of rustdoc</p>
<p>I do feel like if we did an RFC about it folks will bring up the github thing and that's why I'm focusing on pluggability; give rustdoc a single API for this, and we write multiple srcgen thingies for it</p>



<a name="233517367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517367">(Apr 07 2021 at 16:07)</a>:</h4>
<p>(unsure if this is what <span class="user-mention" data-user-id="232545">@Joshua Nelson</span> means)</p>



<a name="233517379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517379">(Apr 07 2021 at 16:07)</a>:</h4>
<p>basically yes</p>



<a name="233517381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517381">(Apr 07 2021 at 16:07)</a>:</h4>
<p>but that's mostly what i'm looking for <span class="user-mention" data-user-id="210316">@GuillaumeGomez</span></p>



<a name="233517383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517383">(Apr 07 2021 at 16:07)</a>:</h4>
<p>Okay, Manish basically just summed up what I was going to say. (Sorry for the delay, Windows Update ate my laptop for a bit)</p>



<a name="233517399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517399">(Apr 07 2021 at 16:07)</a>:</h4>
<p>i think having a trait API for this would make it much much easier to maintain</p>



<a name="233517462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517462">(Apr 07 2021 at 16:08)</a>:</h4>
<p>if there's an explicit opt-in for github then <a href="http://docs.rs">docs.rs</a> can say "use github for things with a github repo and use the built-in src viewer otherwise"</p>



<a name="233517466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517466">(Apr 07 2021 at 16:08)</a>:</h4>
<p>intra doc links is scattered through the code and it's not great but it's also ... a one time thing</p>



<a name="233517487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517487">(Apr 07 2021 at 16:08)</a>:</h4>
<p>or even use its own source viewer instead of rustdoc's</p>



<a name="233517495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517495">(Apr 07 2021 at 16:08)</a>:</h4>
<p>--srclinks=github=manishearth/elsa:1.2.3</p>



<a name="233517520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517520">(Apr 07 2021 at 16:08)</a>:</h4>
<p>idk</p>



<a name="233517584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517584">(Apr 07 2021 at 16:09)</a>:</h4>
<p>oh I guess we do have to pass it for each crate at once, since you can view the source of an item re-exported from another crate</p>



<a name="233517608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517608">(Apr 07 2021 at 16:09)</a>:</h4>
<p>see this is exactly why an RFC would be useful <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="233517658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517658">(Apr 07 2021 at 16:09)</a>:</h4>
<p>The specifics can be an RFC, but I like the overall idea proposed :P</p>



<a name="233517998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233517998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233517998">(Apr 07 2021 at 16:11)</a>:</h4>
<p>To note that one reason I approve of this kind of design is the reason JSON bugs have some pain points: HTML was the only generator for so long, it's woven forward and back through the system. There isn't as clear a line of 'backend/generator', meaning that even entirely within rustdoc JSON leaks HTML implementation details sometimes.<br>
Adopting a separated design from the start saves you from later issues, meaning we don't need external tools, but we make sure we aren't accidentally shooting ourselves in the foot down the line</p>



<a name="233518570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233518570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233518570">(Apr 07 2021 at 16:15)</a>:</h4>
<blockquote>
<p>Adopting a separated design from the start saves you from later issues, meaning we don't need external tools, but we make sure we aren't accidentally shooting ourselves in the foot down the line</p>
</blockquote>
<p>Yeah this is my core point</p>



<a name="233518575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233518575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233518575">(Apr 07 2021 at 16:15)</a>:</h4>
<p>well i have many core points</p>



<a name="233518585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233518585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233518585">(Apr 07 2021 at 16:15)</a>:</h4>
<p>but i want to +1 that</p>



<a name="233527716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233527716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233527716">(Apr 07 2021 at 17:14)</a>:</h4>
<p>I think this is over-engineering. Way too much. We're talking about a feature in the HTML generator. Just like no one (I know of) is using their own theme, I don't see anyone adding their own source code generator. Making things generic and extendable is rarely a good idea if it's not meant to be. But anyway, it's still far into the future, for now I'm still working on the POC that will remain disabled by default until we reach an agreement on what this feature should look like. Do you think it's fine as a start?</p>



<a name="233543099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233543099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233543099">(Apr 07 2021 at 18:58)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span>  No, I'm not saying we should do this to enable others to write their own srcgen (I explicitly said earlier: it's going to be an unstable API, nobody will want to use it), I'm saying we should do this to make it easy to maintain internally</p>



<a name="233543145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233543145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233543145">(Apr 07 2021 at 18:58)</a>:</h4>
<p>because my _guess_ is that it's goign to end up being way more complex than your current PR; and I want that code abstracted by a trait</p>



<a name="233543183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233543183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233543183">(Apr 07 2021 at 18:59)</a>:</h4>
<p>and _if we do that_ it becomes easy to add "plain" srcdoc and "link to github" srcdoc</p>



<a name="233543228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233543228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233543228">(Apr 07 2021 at 18:59)</a>:</h4>
<p>the latter is definitely something people want as well, and i'm talking about it because a unified solution is nice</p>



<a name="233544049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233544049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233544049">(Apr 07 2021 at 19:04)</a>:</h4>
<p>Ah I see, makes sense.</p>



<a name="233544419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/extend%20source%20code%20viewer/near/233544419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/extend.20source.20code.20viewer.html#233544419">(Apr 07 2021 at 19:06)</a>:</h4>
<p>like, i have two primary concerns here:</p>
<ul>
<li>maintenance</li>
<li>understanding the scope</li>
</ul>
<p>the former is helped by abstracting it away properly (and as a bonus we can make --srcdoc github work later!). the latter is helped by an rfc and an internals post so we know how far we have to go with this</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>